import React, { useState, useEffect } from 'react';
import '../css/remen.css';
import axios from 'axios';

export default function remen() {
  const [relist, setrelist] = useState([]);

  const getlist = async () => {
    const { data } = await axios.get('http://localhost:3000/yrt/relist');
    if (data.code === 200) {
      setrelist(data.data);
    }
  };

  useEffect(() => {
    getlist();
  }, []);

  return (
    <div className="apps">
      {relist.map((item) => (
        <div key={item._id} className="neixun">
          <div className="buju">
            <div className="imgpai">
              <img src={item.img} alt="" />
            </div>
            <p>{item.jinbi}币</p>
            <s>{item.jinbinum}</s>
          </div>
        </div>
      ))}
      <div className="chankan">
        <p>查看更多</p>
      </div>
    </div>
  );
}
